<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!-- Header section -->
	<header class="header-wrapper">
		<div class="container">
			<!-- Logo link -->
			<a href='main-general.jsp' class="logo"> <img alt='logo'
				src="themovieimg/logo.png"> <span
				style="color: white; margin-left: 70px; font-size: 20px; font-family: 幼圆;"><b>爆米花票务</b></span>
			</a>

			<!-- Main website navigation-->
			<nav id="navigation-box">

				<!-- Link navigation -->
				<ul id="navigation">
					<li><span class="sub-nav-toggle plus"></span> <a
						href="main-general.jsp">首页</a></li>
					<li><span class="sub-nav-toggle plus"></span> <a href="#">电影信息</a>
						<ul>
							<li class="menu__nav-item"><a href="movie-list-left.jsp">全部电影</a></li>
							<li class="menu__nav-item"><a
								href="movie-playing-general.jsp">正在热映</a></li>
						</ul></li>
					<li><span class="sub-nav-toggle plus"></span> <a href="#">排行榜</a>
						<ul>
							<li class="menu__nav-item"><a
								href="rates-left-hotsaleslist-general.jsp">上映销量榜</a></li>
							<li class="menu__nav-item"><a
								href="rates-left-highscorelist-general.jsp">上映高分榜</a></li>
							<li class="menu__nav-item"><a
								href="rates-left-collectionlist-general.jsp">收藏榜</a></li>
						</ul></li>
					<li><span class="sub-nav-toggle plus"></span> <a
						href="offers">关于会员</a></li>
					<li><span class="sub-nav-toggle plus"></span> <a
						href="contact.html">关于我们</a></li>
				</ul>
			</nav>

			<c:choose>
				<c:when test="${empty username}">
					<!-- Additional header buttons / Auth and direct link to booking-->
					<div class="control-panel" id="nologin">
						<a href="#"
							class="btn btn-md btn--warning btn--book btn-control--home login-window">登录</a>
					</div>
				</c:when>

				<c:otherwise>
					<!-- Additional header buttons / Auth and direct link to booking-->
					<div class="control-panel" id="logined">
						<div class="auth auth--home">
							<div class="auth__show">
								<span class="auth__image"> <img id="uimg" alt=""
									src="<%=session.getAttribute("userpic")%>">
								</span>
							</div>
							<a id="un" href="#" class="btn btn--sign btn--singin"> <%=session.getAttribute("username")%>
							</a>
							<ul class="auth__function">
								<li><a href="account.jsp" class="auth__function-item">个人中心</a></li>
								<li><a href="javascript:;" onclick="logout()"
									class="auth__function-item">退出登录</a></li>
							</ul>
						</div>
					</div>
				</c:otherwise>

			</c:choose>

		</div>
	</header>
	
	<script type="text/javascript">

		$("#uimg").attr("src",$.session.get("userpic"));
		
		$("#un").text($.session.get("username"));
		
	</script>



</body>
</html>